Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

[WIP] add source link support to portable pdbs #5860

Closed
wants to merge 14 commits into from

Conversation

ctaggart
Copy link

@ctaggart ctaggart commented Feb 27, 2017

This builds off the csproj branch #5852. It just demos adding source link support. It has the same changes I made to dotnet/efcore#7726. Please see the comments there. Let's see if this build is better maintained.

Here are the steps for trying it out here:

git clone git@github.com:ctaggart/Mvc.git -c core.autocrlf=input
cd Mvc\src\Microsoft.AspNetCore.Mvc
dotnet build /p:ci=true
dotnet sourcelink print-json .\bin\Debug\netstandard1.6\Microsoft.AspNetCore.Mvc.Abstractions.pdb
dotnet sourcelink print-urls .\bin\Debug\netstandard1.6\Microsoft.AspNetCore.Mvc.Abstractions.pdb
dotnet sourcelink test .\bin\Debug\netstandard1.6\Microsoft.AspNetCore.Mvc.Abstractions.pdb

The dotnet sourcelink commands are just showing you that everything is working.

NTaylorMullen and others added 12 commits February 25, 2017 19:30
- Allow >= RC3 CLI's to build and run MVC.
- Added extra sln's so they could be opened in VS. Currently VS' project system can't currently handle Mvc.sln.
- Worked around several dotnet migration issues. They are listed in the re-attempted migration section here: aspnet#5482
- One large feature bit that couldn't be worked around was the functional tests running on desktop; it represented several known vstest issues. Removed desktop running of functional tests.
- Skipped an ActionContextAccessor test due to a vstest appdomain problem.
- see 63507c8 for previous, project.json work
- xUnit no longer supports .NET 4.5.1
- build tests for desktop .NET only on Windows
- always place xunit.runner.visualstudio dependency after xunit; helps build scripts run correctly
Question: Should Microsoft.Extensions.DependencyModel dependency really be 1.1.0?
…s from dev

- manually recreate *.sln files to correct VS versions and use old project GUIDs
  - add missing lines to the .sln files; build configuration likely not used before
- manually migrate RazorPagesWebSite project
- remove `ToolsVersion` attributes
- add repo.props file; never test TestCommon project and only build Mvc.sln
- add dependencies.props file to match other repos

Test-related:
- add `$(PreserveCompilationContext)` to test projects that examine their own dependencies
- remove comments from xunit.runner.json files; xUnit does not support them
- remove .notest files
- work around inability to deserialize a odd `ref` type
  - xUnit and vstest now serialize / deserialze test data more often
- work around microsoft/vstest#419 instead of skipping test
- enable testes that hit microsoft/vstest#427; bug has been fixed
- add `<Service>`s to test projects
- build unconditionally creates a package if this is in the shared folder
- basically, remove the .xproj that's in old world and compile the files in
- re-enable .NET Framework run of the functional tests
  - disable shadow copying
- add support for `/p:GenerateBaselines=true` for functional and Razor.Host tests
- remove aspnet/KoreBuild#182 workaround; bug fixed
- remove `Microsoft.DotNet.InternalAbstractions` and `System.Xml.XmlDocument` dependencies
- stop floating `$(CoreFxVersion)` and `Microsoft.Extensions.DependencyModel` dependencies
- separate `GetCSharpTypeName_ReturnsCorrectTypeNames_ForOutParameter()` test
- remove `$(RuntimeIdentifier)` settings

nits:
- remove all web.config files
- remove conditional compilation from class libraries
- remove unnecessary project properties from `UserClassLibrary`
- move a few properties to the top of a .csproj file
- remove some trailing whitespace in .csproj files
@dnfclas
Copy link

dnfclas commented Feb 27, 2017

@ctaggart,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

@@ -0,0 +1,11 @@
<Project>
<PropertyGroup>
<SourceLinkCreate>true</SourceLinkCreate>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forcing it on with <SourceLinkCreate>true</SourceLinkCreate> is just to show that it works. The line should be removed before a merge.

Copy link
Contributor

@pranavkm pranavkm Feb 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would we remove it? Isn't the plan to enable the feature by default?

Copy link
Author

@ctaggart ctaggart Feb 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to run source link on whatever you are using as your build server. It doesn't need to run every time someone is doing development locally. It is setup by default to be enabled when the CI environment variable is set to true. This works for AppVeyor, Travis CI, and others. You can also turn on SourceLinkCreate by passing in the property dotnet build /p:SourceLinkCreate=true or /p:CI=true. Hope that helps.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @natemcmaster - something for us to track in KoreBuild.

<SourceLinkNoAutoLF>true</SourceLinkNoAutoLF>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SourceLink.Create.GitHub" Version="2.0.0-*" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be PrivateAssets="all'

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I'll update it and my docs.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidfowl Just to confirm, is only has stuff in the build folder. PrivateAssets="all" is needed for build only packages?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It'll make sure it doesn't end up in the dependencies of the packages produced. Hopefully we get this fixed NuGet/Home#4125. Which means this will automatically happen for packages marked as dev dependencies.

@dougbu dougbu force-pushed the dougbu/migration branch 2 times, most recently from a136c86 to acfad83 Compare March 1, 2017 05:50
@ctaggart
Copy link
Author

ctaggart commented Mar 4, 2017

Closing this pull request. It was just an example of how easy it is to add.

@ctaggart ctaggart closed this Mar 4, 2017
@ctaggart ctaggart deleted the sourcelink branch March 4, 2017 20:51
@ctaggart ctaggart restored the sourcelink branch March 4, 2017 20:51
@ctaggart ctaggart deleted the sourcelink branch March 4, 2017 22:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants